//
//  ErrorPage_Vc.swift
//  LocaLink
//
//  Created by Icy on 2017/3/7.
//  Copyright © 2017年 Icy. All rights reserved.
//

/*
 owner:cy
 update:2017年03月07日21:18:35
 info: ErrorPage_Vc
 */
import RxSwift
import UtilCore

class ErrorPage_Vc: Base_Vc {
    
    /****************************Storyboard UI设置区域****************************/
    @IBOutlet weak var close_Btn: UIButton!
    
    @IBOutlet weak var tryAgain_Btn: UIButton!
    
    @IBOutlet weak var top_desc_Lb: UILabel!
    /*----------------------------   自定义属性区域    ----------------------------*/
    var didTryAgain_Block:((Void) ->Void)?
    
    /****************************Storyboard 绑定方法区域****************************/
    
    
    
    /**************************** 以下是方法区域 ****************************/
    override func viewDidLoad() {
        super.viewDidLoad()
        self.top_desc_Lb.text = "Sorry,we filed to open \nthe doors"
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }
    /**
     界面基础设置
     */
    override func setupUI() {
        /**
         *  自定义 导航栏左侧 返回按钮
         */
        self.customLeftBarButtonItem()
    }
    
    /**
     绑定到viewmodel 设置
     */
    override func bindToViewModel(){
        self.close_Btn
            .rx.tap
            .subscribe(onNext: { [unowned self] ( _ ) in
                self.dismiss(animated: true){ _ in
                    
                }
            })
            .disposed(by: disposeBag)
        self.tryAgain_Btn
            .rx.tap
            .subscribe(onNext: { [unowned self] ( _ ) in
                self.dismiss(animated: true){ _ in
                    self.didTryAgain_Block?()
                }
            })
            .disposed(by: disposeBag)
        
    }
}
